/*
 * StartStopButtonListener.hpp
 *
 *  Created on: 27-12-2010
 *      Author: Przemek
 */

#pragma once

#include "gui/MouseListener.hpp"
#include "gui/Button.hpp"
#include "pch.hpp"

/*
 * A listener which simply starts or stops the world time when mouse is released and updates button caption
 * to valid text (Start or Stop based on world running state).
 */
class StartStopButtonListener: public MouseListener
{
	private:
		static const std::string STOPPED_TEXT;
		static const std::string STARTED_TEXT;
		bool running;
		Button* button;

	public:
		StartStopButtonListener(Button* button);
		void mouseReleased(const MouseListener::EventArguments& arguments);

	private:
		void updateCaption();
};

